Skip to content

Pass changelog unmodified, let LogAgent swap the JIRA references#508

Draft
antbob wants to merge 1 commit into
packit:mainfrom
antbob:simplify_consistent_changelog
Draft

Pass changelog unmodified, let LogAgent swap the JIRA references#508
antbob wants to merge 1 commit into
packit:mainfrom
antbob:simplify_consistent_changelog

Conversation

@antbob
Copy link
Copy Markdown
Collaborator

@antbob antbob commented May 20, 2026

Now the source changelog is passed through unmodified, and the LogAgent is told to only swap the JIRA issue references in Resolves/Related lines. This provides better changelog consistency based on our trials and also simplifies the logic making it less error prone. The downside is that the model can make a mistake when swapping JIRA references (if they are present) but that remains to be seen as so far it has behaved correctly on multiple trials.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request modifies the backport agent to stop filtering out 'Resolves' and 'Related' lines from source changelogs and updates the log agent's instructions to replace JIRA references within those lines. Feedback indicates that these changes risk creating malformed changelogs with duplicate or missing 'Resolves' lines when multiple commits are combined, and that JIRA references in descriptive lines may not be correctly handled.

Comment on lines 818 to 820
if line not in seen:
seen.add(line)
collected_lines.append(line)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Removing the filtering of Resolves/Related lines while maintaining the seen deduplication logic can lead to malformed changelogs when multiple commits are combined. If different commits have different JIRA references, all of them will be collected. For example, combining two commits might result in a list like this being passed to the LogAgent:

- Fix feature A
- Resolves: RHEL-1
- Fix feature B
- Resolves: RHEL-2

When the LogAgent processes this with the instruction to "Only replace... with <JIRA_ISSUES>", it will likely produce multiple identical Resolves lines for the current JIRA (e.g., two - Resolves: RHEL-3 lines), which is incorrect for RPM changelogs. Consider either continuing to strip these lines here or updating the LogAgent instructions to handle consolidation.

Comment thread ymir/agents/log_agent.py
Comment on lines +46 to +47
rephrase, summarize, or add to them. Only replace the Jira issue references
in any Resolves/Related lines with <JIRA_ISSUES>.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The updated instructions for the LogAgent when a source_changelog is provided introduce several risks:

  1. Missing Resolves line: If the source changelog doesn't happen to contain a Resolves or Related line, the agent is not explicitly instructed to add one, which could result in an invalid RHEL changelog entry.
  2. Redundant lines: As noted in the backport_agent.py review, combining multiple source commits can lead to multiple Resolves lines. The "Only replace" instruction doesn't account for consolidating them into a single line.
  3. Incomplete swapping: JIRA references within descriptive lines (e.g., - Fix bug (RHEL-123)) are not covered by the "Resolves/Related lines" restriction and will remain in the output, causing inconsistency.

Consider refining the instructions to ensure a single, consolidated Resolves line is present at the end, while still preserving the descriptive content.

@antbob antbob marked this pull request as draft May 20, 2026 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant